/*
* Copyright 2010 Pavel Kozhin 
*
* Licensed under the Apache License, Version 2.0 (the "License"); 
* you may not use this file except in compliance with the License. 
* You may obtain a copy of the License at 
* 
* http://www.apache.org/licenses/LICENSE-2.0
* 
* Unless required by applicable law or agreed to in writing, software 
* distributed  under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
* See the License for the specific language governing permissions and 
* limitations under the License.
*
* Author: Pavel Kozhin.
*/

package org.bookmarksframework
{
	import org.bookmarksframework.core.browser.IBrowserAdapter;

	public class BookmarksConfig
	{
		/**
		 *  Path separator is used to separate fragment parts from each other
		 *  e.g. fragmentPart1/fragmentPart2/fragmentPart3.
		 * 
		 *  @default "/"
		 */
		public var pathSeparator:String = "/";
		
		/**
		 *  Committing path calls traversing fragments which belong to committed 
		 *  path, so this value is used to vary frames needed for delay between 
		 *  fragments committments during traversing. 
		 *  <p>It affects performance and the whole time of path processing.</p>
		 * 
		 *  @default 1
		 */
		public var committmentDelay:int = 1;
		
		/**
		 *  It forces paths to be strict which means always to start with path 
		 *  separator. 
		 * 
		 *  @default false 
		 */
		public var useStrictPath:Boolean = false;
		
		/**
		 *  Adapter to make wraper for any custom object which can provide necessary 
		 *  functionality to support browser management. Bookmarks framework provides
		 *  two default classes as adapters BrowserManagerAdapter and SWFAddressAdapter.
		 * 
		 *  @see org.bookmarksframework.core.browser.BrowserManagerAdapter
		 *  @see org.bookmarksframework.core.browser.SWFAddressAdapter
		 * 
		 *  @default null 
		 */
		public var browserAdapter:IBrowserAdapter = null;
		
		/**
		 *  Function is used to extract path from context. Context can be equal to path 
		 *  but its purpose to transfer additional information/data along with path.
		 *  For example there is a need to transfer additional data in the form of 
		 *  pairs name and value e.g. data1=true&data2=17 etc with a string which goes
		 *  after # sign in web browser, which means with bookmarks path. So you can get 
		 *  to string like "data1=true&[fragment1/fragment2/]data2=17&data1=foo" and 
		 *  <code>pathResolver</code> handles "fragment1/fragment2/" path extraction 
		 *  from the whole string/context.
		 *  
		 * <pre>function(context:String):String</pre>
		 * 
		 *  @default null
		 */
		public var pathResolver:Function = null;
		
		/**
		 *  Function is used to inject path into context.<br><br>
		 * 
		 *  <pre>function(path:String, context:String):String</pre>
		 * 
		 *  @default null
		 */
		public var contextFormatter:Function = null;
		
	}
}